const functionAPI = {
  queryFunctionList: appId => {
    return $http
      .post(`${window.RPConfig.mgt}/function/findFunction?applicationId=${appId}`)
      .then(response => response.data);
  },
  addFunction: param => {
    return $http.post(`${window.RPConfig.mgt}/function/add`, param).then(response => response.data);
  },
  updateFunction: param => {
    return $http.post(`${window.RPConfig.mgt}/function/update`, param).then(response => response.data);
  },
  deleteFunction: param => {
    return $http.post(`${window.RPConfig.mgt}/function/delete`, param).then(response => response.data);
  },
  getFunctionLang: id => {
    return $http.get(`${window.RPConfig.mgt}/function/name/lang/list?functionId=${id}`).then(response => response.data);
  },
  updateFunctionLang: param => {
    return $http.post(`${window.RPConfig.mgt}/function/name/lang/update`, param).then(response => response.data);
  },
  getLang: id => {
    return $http.get(`${window.RPConfig.mgt}/function/name/lang/list?functionId=${id}`).then(response => response.data);
  }
};
export default functionAPI;
